<template>
	<view class="message_box">
		<view class="message_title">
			{{titile}}
		</view>
    
    <view class="message_time">
      {{time}}
    </view>
    
    <view class="message_box">
      <!-- 不需要引入，可直接使用 -->
      <mp-html :content="detail" />
      
    </view>
				
	</view>
</template>

<script>
export default {
		data() {
			return {
				pageId: null,
        titile: ' ',
        time: ' ',
        detail: ' '
			}
		},
		onLoad(options) {	
      this.pageId = options.id
      console.log(options.id);
      this.getInfo(this.pageId)
		},
		methods:{
      getInfo(id){
        uni.showLoading({title: '加载中'})
        console.log('unin.$get(this.path ');
        console.log(this.path + '/info/get/' + id);
        uni.$get(this.path + '/info/get/' + id).then(res => {
          if(res.code == 200){
            this.titile = res.data.infoTitle
            this.time = res.data.infoCreateTime
            this.detail = res.data.infoContent
            uni.hideLoading()
          }else{
            uni.hideLoading()
            uni.showToast({
              title: '获取消息失败 请重试',
              icon:'none'
            })
          }
        })
      }
    }
	}
</script>

<style lang="scss">
	.message_box {
		width: 700rpx;
		height: 100vh;
		margin: 30rpx auto;
		border-radius: 30rpx;
		background-color: #fff;
    .message_title{
      padding: 30rpx 20rpx 0 20rpx;
      line-height: 40rpx;
      font-size: 30rpx;
      color: #24243F;
    }
    .message_time{
      color: #9F9F9F;
      margin: 0 20rpx;
      line-height: 40rpx;
      font-size: 24rpx;
      margin-top: 13rpx;
      padding-bottom: 43rpx;
      border-bottom: 2rpx solid #E2E2E2;
    }
	}
</style>